<?php
namespace app\index\validate;

use think\Validate;
use app\index\model\User;

class Common extends Validate
{
    
    public function checkCode($value,$rule,$data)
    {
        if($value==session('answer')){
            return true;
        }else{
            return "人类验证不通过";
        }
    }

    public function checkkiss($value,$rule,$data)
    {
        $user = User::get(session('uid'));

        if($user->kiss<$value){
            return "飞吻不够，请先充值";
        }

        return true;
    }

}
